package com.xinongbest.cloud.mall.practice.common.exception;

public class ImoocMallException extends RuntimeException {
    private final Integer code;

    private final String msg;

    public ImoocMallException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ImoocMallException(ImoocMallExceptionEnum en) {
        this(en.getCode(), en.getMsg());
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    @Override
    public String toString() {
        return "ImoocMallException{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                '}';
    }
}
